wasm: on-demand materialize + wrappers; non-fatal pinned init#5
Open
tiljrd wants to merge 5979 commits intotil/forking-capabilitiesfrom
Open
wasm: on-demand materialize + wrappers; non-fatal pinned init#5tiljrd wants to merge 5979 commits intotil/forking-capabilitiesfrom
tiljrd wants to merge 5979 commits intotil/forking-capabilitiesfrom
Conversation
Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…ys with keeper format Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
… to prevent errors Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…e GET parity Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…regen gateway Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…l-get forking(grpc): add single-pool GET support via gRPC; key normalization parity with keeper
…*} in HTTP bindings Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…d pulsar artifacts Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…rrower; robust key parsing for double-slash prefixes Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…ider, borrower; robust key parsing for double-slash prefixes" This reverts commit 7cf4e3d.
…ed files by taking remote; will regenerate next Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…ing; route lp/ and loan/ keys Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…N/0XUPPERHEX); add saver single-GET Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…AIN/0x.. -> CHAIN.ETH and CHAIN.0X.. for single GETs Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…rower) to avoid list failures Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…case-insensitive address match Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
… pool asset before parsing
…/0X and case-insensitive match
…er with {asset=**}; regenerate gateway/types
This allows mimir transactions to bypass all ante handlers including the SDK's DeductFeeDecorator, enabling them to work in test/forking environments where validators may not have unbonded funds.
In forking mode, the bond module may have 0 balance. This change checks the bond module balance before attempting to transfer fees and skips the transfer if insufficient, allowing mimir transactions to succeed in test/forking environments.
…authz integration
…kv-collision app: deduplicate KVStoreKeys to fix 'acc' collision after authz integration
…materialize' into devin/1755993593-wasm-on-demand-materialize # Conflicts: # x/thorchain/forking/client.go
…minimal diagnostic to ensure WASMPERMISSIONLESS routing
…tantiate work without Mimir votes
… directly in forking mode; keep node vote and success logs
…n be validated against forked state
…N; no functional change
…w txs in forked mode
…CheckTx hangs when remote bank/auth reads fail
…ence query hangs in forking mode
…ccount/sequence; fix Mimir tx hang in forking
…id mempool hangs; rely on DeliverTx for remote
…nblock account/sequence; keep others blocked
…o unblock account/sequence in forking mode
…x hang when bypassing in forking mode
…rnode tx/query/keys can initialize with forking enabled
…or thornode tx/query
… (fix unknown flag on mimir)
…o appOpts in tx/query subcommands
…e ctx and retry; add bank client init
…nk-balances Disable remote reads for bank balances in forking mode
…t 10s timeout; always set user-api-call
…eight forwarding and user-api-call
…s; log invalid height param
…ance-hang fix: prevent REST bank balance hang in forking mode (gateway timeout + broader height forwarding)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable mainnet WASM data availability on forked THORChain
Summary
This PR implements CosmWasm support for the THORChain forking client, allowing forked networks to access mainnet contract state and bytecode via gRPC. The implementation includes:
The changes enable smart contract queries like
thornode query wasm contract-state smart <addr> '{"config":{}}'to work on forked networks by transparently fetching missing contract data from mainnet.Review & Testing Checklist for Human
thornode tx wasm executeworks without "not found" errors (the current test failed due to missing keyring key "mnc")x/thorchain/forking/client.golines 973-1009, especially the address reconstruction from raw bytesx/thorchain/forking/store.golines 128-131 doesn't hide legitimate issues during developmentRecommended test plan: Deploy the updated thornode image, run smart queries against known mainnet contracts, import a funded key, and execute a simple contract transaction to verify the full read/write flow works correctly.
Diagram
%%{ init : { "theme" : "default" }}%% graph TB Client["thornode CLI<br/>wasm queries"] QueryWrapper["app/query_wasm_wrapper.go<br/>WasmQueryWrapper"]:::major-edit MsgWrapper["app/msg_wasm_wrapper.go<br/>WasmMsgWrapper"]:::major-edit Materializer["app/wasm_materialize.go<br/>materializeAndPinWasm"]:::major-edit ForkingStore["x/thorchain/forking/store.go<br/>forkingKVStore"]:::minor-edit ForkingClient["x/thorchain/forking/client.go<br/>remoteClient"]:::major-edit MainnetGRPC["grpc.thor.pfc.zone:443<br/>Mainnet gRPC"]:::context LocalFS["data/wasm/wasm/<br/>Local bytecode files"]:::context Client --> QueryWrapper Client --> MsgWrapper QueryWrapper --> Materializer MsgWrapper --> Materializer QueryWrapper --> ForkingStore MsgWrapper --> ForkingStore ForkingStore --> ForkingClient ForkingClient --> MainnetGRPC Materializer --> LocalFS QueryWrapper --> MainnetGRPC MsgWrapper --> MainnetGRPC subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
Session details: Requested by Til Jordan (@tiljrd) - https://app.devin.ai/sessions/24b3b308ea114effa590c47c761c616d